Repository navigation
Fix Power Flow and Console responsive layout - #205
Conversation
Keep the low-SoE label inside the battery graphic, center grid/home labels, keep gateway details readable with multiple gateways, and optically center status pills, gateway tags, and the active header link.
There was a problem hiding this comment.
🟡 Changes recommended
Long hostnames or gateway IDs can overflow narrow gateway cards and overlap the connection status because .gateway-host lacks a rule to break long text.
1 open issue
What changed in this PR
Improves responsive layout and text alignment in the Power Flow and Console views, with shared header styling also applying to History.
Changes:
- Keeps low-charge battery percentages visible and centers Power Flow labels over icons on narrow cards.
- Reworks gateway cards to improve badge readability and place connection status beside host information.
- Adjusts status-pill, badge, and navigation text alignment.
| File | Description |
|---|---|
RELEASE.md |
Documents the display fixes under the upcoming release. |
app/static/powerflow/app.js |
Adds responsive diagram sizing and updates power and battery label positioning. |
app/static/index.html |
Revises gateway-card layout and aligns status pills and badges. |
app/static/css/page.css |
Centers shared header-link text for Console and History. |
Review effort: Balanced
|
Thanks @erikgieseler! This is a great cleanup, and the before/after screenshots and measurements made it easy to review. I tested it against the pwsimulator from 320 to 1400px, and it holds up:
A few small things before it can merge:
Would you like to do these yourself, or would you like us to push them to your branch? Either is fine with me. Just let me know. |
|
Feel free to make the changes yourself if you have the time. I won't be able to get to it until this evening at the earliest. |
- .gateway-host wraps long hostnames and IPv6 addresses inside its column instead of running into the connection status on narrow cards (Copilot) - drop the unused viewportWidth destructure; setState already re-renders - explain the 136px reserved beside the diagram for the grid/home circles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @erikgieseler! I pushed the four changes to your branch:
All 1367 tests pass. I re-checked it against the simulator at 320px: hostnames stay in their column, Power Flow renders, and the console shows no errors. Let me know if you'd like anything done differently. |

Summary
Fixes five responsive/display issues in the Power Flow and Console views:
4%were cut off at the bottom of the Power Flow card. The label now bottom-aligns inside the battery graphic only when it would otherwise overflow.ConnectedandControl enabledlabels were mathematically inside the pill but sat slightly low optically. They now use a centered flex line box.Screenshots
All pairs were captured with Playwright/Chrome at 2x device scale from actual source: before uses
d680c92, after uses the UI source from this branch.git diff d680c92..9f1879c -- app/static/index.html app/static/css/page.css app/static/powerflow/app.jsis empty, so the before screenshots also match base9f1879cfor the files involved. Power Flow used fixed API responses: one frozen aggregates response for both sides, SoE4%for the 1400px (624px iframe) SoE pair, and SoE50%for the 380px (306px iframe) label pair so the screenshots isolate the label layout. Gateway screenshots used the same fixed gateway/version payloads for both sides, with the actual old/new CSS fromindex.htmlat 380px and 1200px. The MQTT/control pill and active-header screenshots use the same live page data with the actual old/new CSS at 1400px.Power Flow battery SoE at 4%
Power Flow at 380px
Gateway details at 380px
Two gateways
Status pills
Active header link
Testing
node --check app/static/powerflow/app.jstests/test_powerflow_api_base.py,tests/test_console_escaping.py,tests/test_api_md.py- 16 passed.PYTHONUTF8=1 python -m pytest -q: 1362 passed, 1 skipped, 3 pre-existing environment-specific failures that also reproduce on baseupstream/main9f1879c:test_battery_dispatch_ui: Windows/German number formatting (5.000vs5,000)test_https: Windows path separator (\vs/)test_legacy_mode_parity: depends on local gateway environment configuration42pxand264px), the right-hand rendered text stays inside the306pxcard in the captured run, and the gateway firmware stays on one line.290.08pxand the glyph at287.23pxagainst a280pxbattery bottom; the new code has both label and glyph bottoms at exactly280px(gap0px).60px/302pxand the right label box ended at362pxagainst a306pxcard; new containers are centered at the icon centers42px/264pxafter the diagram shrinks.121px, firmware badge36px, and the status was below the name; new card is101px, keeps the firmware badge at20px, and puts the status in the same CSS grid row as the host/IP, centered byalign-items: centerwithout a fixed vertical offset.20px-high firmware badges; at 1200px the new grid uses two columns (547pxcards) and both firmware badges stay on one line. The old 3-column layout squeezed the first card to359.33pxand wrapped its firmware to36px.24pxagainst a pill center of22.5px(visibly low); the new ink center is22pxwith equal flex centering.38.5pxvs box center36.5px; new ink center is exactly36.5px.21px/20.5pxvs box center19.5px; new centers are19px/18.5px.app.jsand fixed API payloads. No failures: labels stayed inside, the circles stayed within the iframe, and low SoE text remained bottom-aligned. Resize checks from 380 -> 600 -> 320 px also updated the diagram width live.